2-phase commit protocol (2PC) is a consensus protocol used for atomically commit or rollback distributed transactions.
wikipedia article